Skip to content

Update provider resources to align with the Spice Cloud API updates#26

Draft
ewgenius wants to merge 1 commit into
trunkfrom
evgenii/2026-03-17/update-api
Draft

Update provider resources to align with the Spice Cloud API updates#26
ewgenius wants to merge 1 commit into
trunkfrom
evgenii/2026-03-17/update-api

Conversation

@ewgenius
Copy link
Copy Markdown
Collaborator

@ewgenius ewgenius commented Mar 17, 2026

Align the Terraform provider with the updated Management API spec.

  • remove deprecated api_key from:
    • spiceai_app
    • data.spiceai_app
    • data.spiceai_apps
  • add support for app resources and executor
  • add support for deployment channel
  • update update_channel validation to current API values

Add resources and executor attributes to app resource

Add channel attribute to deployment resource

Update docs for new attributes and schemas
@ewgenius ewgenius self-assigned this Mar 17, 2026
@ewgenius ewgenius requested a review from a team March 17, 2026 10:49
@ewgenius ewgenius changed the title Remove api_key from app data sources and resource Update provider resources to align with the Spice Cloud API updates Mar 17, 2026
@ewgenius ewgenius added the enhancement New feature or request label Mar 17, 2026
@ewgenius ewgenius requested a review from Copilot March 17, 2026 10:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Terraform provider’s app and deployment resources to match recent Spice Cloud API changes, including new configuration fields and updated documentation.

Changes:

  • Add resources and executor nested configuration blocks to spiceai_app, including expand/flatten mappings to API structs.
  • Add channel override to spiceai_deployment create request and schema.
  • Remove api_key from app resource and app data sources, and refresh docs to reflect the new/updated schemas.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/provider/resource_deployment.go Adds channel attribute to deployment schema/model and sends it on create.
internal/provider/resource_app.go Adds resources and executor schema/model support; implements expand/flatten helpers and wires them into update/read mapping; removes api_key from resource.
internal/provider/datasource_apps.go Removes api_key from the apps list data source model/schema/mapping.
internal/provider/datasource_app.go Removes api_key from the single app data source model/schema/mapping.
internal/client/client.go Extends API client structs for app config (resources, executor) and deployment create (channel); adds new resource/executor structs.
docs/resources/deployment.md Documents new optional channel attribute for deployments.
docs/resources/app.md Documents new resources and executor nested schemas; updates update_channel valid values; removes api_key from read-only attributes.
docs/data-sources/apps.md Removes api_key from apps data source docs.
docs/data-sources/app.md Removes api_key from app data source schema docs (but example usage still references it).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +142 to +148
"channel": schema.StringAttribute{
MarkdownDescription: "Override the deployment channel for this deployment. Valid values are `stable`. Changing this forces a new deployment to be created.",
Optional: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
Comment thread docs/data-sources/app.md
Comment on lines 67 to 71
### Read-Only

- `api_key` (String, Sensitive) The API key for the app.
- `cluster_id` (String) The Kubernetes cluster identifier where the app is deployed.
- `cname` (String) The region identifier (cname) for the app.
- `created_at` (String) The timestamp when the app was created.
Comment on lines +901 to +905
func expandContainerResources(value types.Object) *client.ContainerResources {
if value.IsNull() || value.IsUnknown() {
return nil
}

@ewgenius ewgenius marked this pull request as draft March 22, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants